﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.PutniNalogAkontacija"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class PutniNalogAkontacijaEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// TextBox for the ID property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxID;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the ID property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDLabel;
		
		/// <summary>
		/// ComboBox for the IDPutniNalog property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDPutniNalog;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDPutniNalog property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDPutniNalogLabel;
		
		/// <summary>
		/// ComboBox for the IDValuta property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDValuta;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDValuta property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDValutaLabel;
		
		/// <summary>
		/// TextBox for the IznosValuta property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxIznosValuta;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IznosValuta property.
		/// </summary>
		protected System.Windows.Forms.Label uxIznosValutaLabel;
		
		/// <summary>
		/// TextBox for the IznosKuna property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxIznosKuna;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IznosKuna property.
		/// </summary>
		protected System.Windows.Forms.Label uxIznosKunaLabel;
		
		/// <summary>
		/// TextBox for the Slovima property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxSlovima;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Slovima property.
		/// </summary>
		protected System.Windows.Forms.Label uxSlovimaLabel;
		
		/// <summary>
		/// ComboBox for the IDBlagajnaStavka property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDBlagajnaStavka;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDBlagajnaStavka property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDBlagajnaStavkaLabel;
		#endregion
		
		#region Main entity
		private Entities.PutniNalogAkontacija _PutniNalogAkontacija;
		/// <summary>
		/// Gets or sets the <see cref="Entities.PutniNalogAkontacija"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.PutniNalogAkontacija"/> instance.</value>
		public Entities.PutniNalogAkontacija PutniNalogAkontacija
		{
			get {return this._PutniNalogAkontacija;}
			set
			{
				this._PutniNalogAkontacija = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxID.DataBindings.Clear();
			this.uxID.DataBindings.Add("Text", this.uxBindingSource, "ID", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDPutniNalog.DataBindings.Clear();
			this.uxIDPutniNalog.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDPutniNalog", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDValuta.DataBindings.Clear();
			this.uxIDValuta.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDValuta", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIznosValuta.DataBindings.Clear();
			this.uxIznosValuta.DataBindings.Add("Text", this.uxBindingSource, "IznosValuta", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIznosKuna.DataBindings.Clear();
			this.uxIznosKuna.DataBindings.Add("Text", this.uxBindingSource, "IznosKuna", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxSlovima.DataBindings.Clear();
			this.uxSlovima.DataBindings.Add("Text", this.uxBindingSource, "Slovima", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDBlagajnaStavka.DataBindings.Clear();
			this.uxIDBlagajnaStavka.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDBlagajnaStavka", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="PutniNalogAkontacijaEditControlBase"/> class.
		/// </summary>
		public PutniNalogAkontacijaEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_PutniNalogAkontacija != null) _PutniNalogAkontacija.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxID = new System.Windows.Forms.TextBox();
			uxIDLabel = new System.Windows.Forms.Label();
			this.uxIDPutniNalog = new System.Windows.Forms.ComboBox();
			uxIDPutniNalogLabel = new System.Windows.Forms.Label();
			this.uxIDValuta = new System.Windows.Forms.ComboBox();
			uxIDValutaLabel = new System.Windows.Forms.Label();
			this.uxIznosValuta = new System.Windows.Forms.TextBox();
			uxIznosValutaLabel = new System.Windows.Forms.Label();
			this.uxIznosKuna = new System.Windows.Forms.TextBox();
			uxIznosKunaLabel = new System.Windows.Forms.Label();
			this.uxSlovima = new System.Windows.Forms.TextBox();
			uxSlovimaLabel = new System.Windows.Forms.Label();
			this.uxIDBlagajnaStavka = new System.Windows.Forms.ComboBox();
			uxIDBlagajnaStavkaLabel = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxIDLabel
			//
			this.uxIDLabel.Text = "ID:";
			this.uxIDLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxIDLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDLabel);			
			//
			// uxID
			//
			this.uxID.ReadOnly = true;
			//this.uxTableLayoutPanel.Controls.Add(this.uxID);
			this.uxID.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxID);
			//
			// uxIDPutniNalogLabel
			//
			this.uxIDPutniNalogLabel.Text = "IDPutniNalog:";
			this.uxIDPutniNalogLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxIDPutniNalogLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDPutniNalogLabel);			
			//
			// uxIDPutniNalog
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDPutniNalog);
			this.uxIDPutniNalog.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxIDPutniNalog);
			//
			// uxIDValutaLabel
			//
			this.uxIDValutaLabel.Text = "IDValuta:";
			this.uxIDValutaLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxIDValutaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDValutaLabel);			
			//
			// uxIDValuta
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDValuta);
			this.uxIDValuta.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxIDValuta);
			//
			// uxIznosValutaLabel
			//
			this.uxIznosValutaLabel.Text = "IznosValuta:";
			this.uxIznosValutaLabel.Location = new System.Drawing.Point(3, 78);
			this.Controls.Add(this.uxIznosValutaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIznosValutaLabel);			
			//
			// uxIznosValuta
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIznosValuta);
			this.uxIznosValuta.Location = new System.Drawing.Point(160, 78);
			this.Controls.Add(this.uxIznosValuta);
			//
			// uxIznosKunaLabel
			//
			this.uxIznosKunaLabel.Text = "IznosKuna:";
			this.uxIznosKunaLabel.Location = new System.Drawing.Point(3, 104);
			this.Controls.Add(this.uxIznosKunaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIznosKunaLabel);			
			//
			// uxIznosKuna
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIznosKuna);
			this.uxIznosKuna.Location = new System.Drawing.Point(160, 104);
			this.Controls.Add(this.uxIznosKuna);
			//
			// uxSlovimaLabel
			//
			this.uxSlovimaLabel.Text = "Slovima:";
			this.uxSlovimaLabel.Location = new System.Drawing.Point(3, 130);
			this.Controls.Add(this.uxSlovimaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxSlovimaLabel);			
			//
			// uxSlovima
			//
			this.uxSlovima.Width = 250;
			this.uxSlovima.MaxLength = 150;
			//this.uxTableLayoutPanel.Controls.Add(this.uxSlovima);
			this.uxSlovima.Location = new System.Drawing.Point(160, 130);
			this.Controls.Add(this.uxSlovima);
			//
			// uxIDBlagajnaStavkaLabel
			//
			this.uxIDBlagajnaStavkaLabel.Text = "IDBlagajnaStavka:";
			this.uxIDBlagajnaStavkaLabel.Location = new System.Drawing.Point(3, 156);
			this.Controls.Add(this.uxIDBlagajnaStavkaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDBlagajnaStavkaLabel);			
			//
			// uxIDBlagajnaStavka
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDBlagajnaStavka);
			this.uxIDBlagajnaStavka.Location = new System.Drawing.Point(160, 156);
			this.Controls.Add(this.uxIDBlagajnaStavka);
			//
			// uxIDBlagajnaStavka
			//				
			this.uxIDBlagajnaStavka.DisplayMember = "IDBlagajnaIzvjestaj";	
			this.uxIDBlagajnaStavka.ValueMember = "ID";	
			//
			// uxIDPutniNalog
			//				
			this.uxIDPutniNalog.DisplayMember = "Oznaka";	
			this.uxIDPutniNalog.ValueMember = "ID";	
			//
			// uxIDValuta
			//				
			this.uxIDValuta.DisplayMember = "Naziv";	
			this.uxIDValuta.ValueMember = "ID";	
			// 
			// PutniNalogAkontacijaEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "PutniNalogAkontacijaEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
				
		private Entities.TList<Entities.BlagajnaStavka> _IDBlagajnaStavkaList;
		
		/// <summary>
		/// The ComboBox associated with the IDBlagajnaStavka property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.BlagajnaStavka> IDBlagajnaStavkaList
		{
			get {return _IDBlagajnaStavkaList;}
			set 
			{
				this._IDBlagajnaStavkaList = value;
				this.uxIDBlagajnaStavka.DataSource = null;
				this.uxIDBlagajnaStavka.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDBlagajnaStavkaList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDBlagajnaStavka property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDBlagajnaStavkaList
		{
			get { return _allowNewItemInIDBlagajnaStavkaList;}
			set
			{
				this._allowNewItemInIDBlagajnaStavkaList = value;
				this.uxIDBlagajnaStavka.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
				
		private Entities.TList<Entities.PutniNalog> _IDPutniNalogList;
		
		/// <summary>
		/// The ComboBox associated with the IDPutniNalog property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.PutniNalog> IDPutniNalogList
		{
			get {return _IDPutniNalogList;}
			set 
			{
				this._IDPutniNalogList = value;
				this.uxIDPutniNalog.DataSource = null;
				this.uxIDPutniNalog.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDPutniNalogList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDPutniNalog property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDPutniNalogList
		{
			get { return _allowNewItemInIDPutniNalogList;}
			set
			{
				this._allowNewItemInIDPutniNalogList = value;
				this.uxIDPutniNalog.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
				
		private Entities.TList<Entities.Valuta> _IDValutaList;
		
		/// <summary>
		/// The ComboBox associated with the IDValuta property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.Valuta> IDValutaList
		{
			get {return _IDValutaList;}
			set 
			{
				this._IDValutaList = value;
				this.uxIDValuta.DataSource = null;
				this.uxIDValuta.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDValutaList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDValuta property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDValutaList
		{
			get { return _allowNewItemInIDValutaList;}
			set
			{
				this._allowNewItemInIDValutaList = value;
				this.uxIDValuta.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
